﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace Loggan.Configurations
{
    class ConfigElement : ConfigurationElement
    {
        #region Constructors

        static ConfigElement()
        {
            propKey = new ConfigurationProperty(
                "key",
                typeof(string),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

            propValue = new ConfigurationProperty(
                "value",
                typeof(string),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

            properties = new ConfigurationPropertyCollection();

            properties.Add(propKey);
            properties.Add(propValue);
        }

        #endregion

        #region Fields

        private static ConfigurationPropertyCollection properties;
        private static ConfigurationProperty propKey;
        private static ConfigurationProperty propValue;

        #endregion

        #region Properties

        public string Key
        {
            get { return (string)base[propKey]; }
            set { base[propKey] = value; }
        }

        public string Value
        {
            get { return (string)base[propValue]; }
            set { base[propValue] = value; }
        }

        protected override ConfigurationPropertyCollection Properties
        {
            get
            {
                return properties;
            }
        }

        #endregion
    }
}
